
package com.gientech.work.demo.springboot;

import java.io.IOException;

import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigService;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import lombok.extern.slf4j.Slf4j;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@Slf4j
@SpringBootApplication
@EnableApolloConfig //启动apollo配置注解

public class SpringBootSampleApplication {


  public static void main(String[] args) throws IOException {
    SpringApplication.run(SpringBootSampleApplication.class, args);

    //指定namespace 获取
    Config appnamespace = ConfigService.getConfig("application");
    String key_value = appnamespace.getProperty("key01", "");
    log.info("获取值：" + key_value);



  }
}
